<{include file="top_v3.html"}>
</head>
<body>
    <header>
        <a class="left_link" href="<{U('index')}>"></a><{$title}><a class="right_link" href="<{$POINT_RULE_URL}>">规则</a></header>
    <dl class="illustrate illustrate-1" style="background-image:none;"><img src="<{$userinfo.uid|headpic}>">我的积分：<{$userinfo.point}>分</dl>
    <div class="nub_box">
        <{foreach from=$list item=item }>
        <article class="nub_con">
            <a href="<{u('info/?id='|cat:$item['id'])}>">
            <{*<div class="graph"><span class="sec">秒抢</span></div> *}>
            <img src="<{$preUploadUrl}><{$item.listPic}>" />

            <{if $item.showStatus == 3}>
            <dl class="hint timeCounter" data-time="<{$item.restTime}>">距开始&nbsp;&nbsp;&nbsp;04:32:12</dl>
            <{else if $item.showStatus == 2}>
                <{if $item.showStock == 0}>
                <dl class="over">已抢完</dl>
                <{/if}>
            <{else if $item.showStatus == 4}>
            <dl class="over">已结束</dl>
            <{/if}>
            <ul>
                <li><{$item.titleList}></li>
                <li>
                    <{* 显示积分与价格 *}>
                    <{if $item.point gt 0 and $item.nowPrice eq 0}>
                    <i><{$item.point}></i>积分
                    <{elseif  $item.point eq 0 and $item.nowPrice gt 0 }>
                    <i><{$item.nowPrice}></i>元
                    <{elseif  $item.point gt 0 and $item.nowPrice gt 0 }>
                    <i><{$item.point}></i>积分 +<i><{$item.nowPrice}></i>元
                    <{/if}>
                </li>
                <li>市场参考价：<{$item.originalPrice}>元</li>
            </ul>
            </a>
        </article>

        <{/foreach}>

    </div>
    <{include file="footer.html"}>

</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {


        timeout();
        function timeout(){
            var $point_timeer = $('.timeCounter');
            $point_timeer.each(function() {
                var time = parseInt($(this).data("time"));
                if(time>0 && time){
                    output_time(time,this);
                }
                $(this).data("time",--time);
            });
            setTimeout(function (){timeout();},1000);
        }
        function output_time (time,obj) {
            var hour = Math.floor(time/60/60);
            var minute = Math.floor((time/60)%60);
            var scond = Math.floor(time%60);
            var day = Math.floor(hour/24);

            if(hour>24){
                hour = hour%24;
                $(obj).html("距开始 "+day+"天"+hour+"小时");
            }else if(hour >= 1 && hour <=24){
                $(obj).html("距开始 "+hour+"小时"+minute+"分");
            }else if(hour <1){
                $(obj).html("距开始 "+minute+"分"+scond+"秒");
            }
        }

    });
</script>

